home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1085 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.6 KB

  1. Date: Thu, 24 Feb 1994 10:31:15 -0500
  2. From: "Nicholas S Castellano" <entropy@terminator.rs.itd.umich.edu>
  3. To: mint@terminator.rs.itd.umich.edu
  4. Subject: mint 1.10: biosfs.c -- bios_getxattr()
  5.  
  6. In bios_getxattr() it's not a good idea to return the attributes of the
  7. file to which a fake device currently is pointing.  Doing so messes
  8. up things like ttyname() in the mint libs, because the /dev directory
  9. ends up with several things pointing to the tty device (e.g. we
  10. usually get "/dev/con" instead of a pipe name).
  11.  
  12. Julian suggested that I change the ttyname() function to search the /pipe
  13. directory before /dev, but that doesn't really fix the problem because
  14. logins on /dev/modem1 will get "/dev/aux" first since it appears earlier in
  15. the device table.  Since these entries in /dev are all supposed to be
  16. character-special files anyway, making them look like different character
  17. special files (or even making them appear to be real files, as may be the
  18. case for /dev/fd/*) is counterintuitive anyway (and can screw up things like
  19. tar, file, and find, which know about devices and inodes.)
  20.  
  21. biosfs.c: ++entropy@terminator.rs.itd.umich.edu
  22.     Don't "follow the chain" for character special devices
  23.     in bios_getxattr().
  24.  
  25. --- 1.10.1.3    1994/02/19 09:09:48
  26. +++ biosfs.c    1994/02/24 14:41:38
  27. @@ -349,9 +349,11 @@
  28.      fcookie *fc;
  29.      XATTR *xattr;
  30.  {
  31. +#ifdef XATTR_FOLLOW_CHAIN
  32.      FILEPTR *f;
  33. -    struct bios_file *b = (struct bios_file *)fc->index;
  34.      long r;
  35. +#endif
  36. +    struct bios_file *b = (struct bios_file *)fc->index;
  37.      int majdev, mindev;
  38.  
  39.      majdev = UNK_RDEV;
  40. @@ -367,26 +369,34 @@
  41.          xattr->dev = fc->dev;
  42.      } else if (IS_FD_ENTRY(fc)) {
  43.          /* u:\dev\fd\n */
  44. +#ifdef FOLLOW_XATTR_CHAIN
  45.          f = curproc->handle[(int)fc->aux];
  46.          if (f) {
  47.              r = (*f->fc.fs->getxattr)(&f->fc, xattr);
  48.              if (r < 0)
  49.                  return r;
  50.          } else {
  51. +#endif
  52.              majdev = FAKE_RDEV;
  53.              mindev = ((int)fc->aux) & 0x00ff;
  54.              set_xattr(xattr, S_IFCHR | DEFAULT_MODE, majdev|mindev);
  55. +#ifdef FOLLOW_XATTR_CHAIN
  56.          }
  57. +#endif
  58.      } else if (b->device == &fakedev) {
  59. +#ifdef FOLLOW_XATTR_CHAIN
  60.          if ((f = curproc->handle[b->private]) != 0) {
  61.              /* u:\dev\stdin, u:\dev\stdout, etc. */
  62.              r = (*f->fc.fs->getxattr) (&f->fc, xattr);
  63.              if (r < 0) return r;
  64.          } else {
  65. +#endif
  66.              majdev = FAKE_RDEV;
  67.              mindev = ((int)b->private) & 0x00ff;
  68.              set_xattr(xattr, S_IFCHR|DEFAULT_MODE, majdev|mindev);
  69. +#ifdef FOLLOW_XATTR_CHAIN
  70.          }
  71. +#endif
  72.      } else {
  73.          *xattr = b->xattr;
  74.          xattr->index = fc->index;
  75.  
  76. --
  77. entropy -- it's not just a good idea, it's the second law.
  78. Personal mail:      entropy@gnu.ai.mit.edu
  79. MiNT library mail:  entropy@terminator.rs.itd.umich.edu
  80. "what do you have against octal?" -jrb
  81.  
  82.